# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=libmatroska
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=1.4.4
pkgrel=1
pkgdesc="Matroska library (mingw-w64)"
arch=('any')
license=('LGPL')
url="https://matroska.org"
depends=("${MINGW_PACKAGE_PREFIX}-libebml")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc"
             "${MINGW_PACKAGE_PREFIX}-pkg-config"
             "automake" "autoconf")
options=('staticlibs')
source=("https://dl.matroska.org/downloads/${_realname}/${_realname}-${pkgver}.tar.bz2")
sha256sums=('d3efaa9f6d3964351a05bea0f848a8d5dc570e4791f179816ce9a93730296bd7')

build() {
  mkdir -p "${srcdir}/build-${MINGW_CHOST}"
  cd "${srcdir}/build-${MINGW_CHOST}"
  ../${_realname}-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --enable-shared \
    --enable-static

  make
}

package() {
  cd "${srcdir}/build-${MINGW_CHOST}"
  make install DESTDIR="${pkgdir}"
}
